Skip to content

Store the Dpop thumbprint to local storage#940

Open
pmathew92 wants to merge 7 commits intodpop_thumbprint_fixfrom
dpop_thumbprint_store
Open

Store the Dpop thumbprint to local storage#940
pmathew92 wants to merge 7 commits intodpop_thumbprint_fixfrom
dpop_thumbprint_store

Conversation

@pmathew92
Copy link
Contributor

Changes

This PR adds support to store the Dpop thumbprint to local storage if DPoP was used while Authenticating the user

References

Should be merged after #939

Checklist

@pmathew92 pmathew92 changed the base branch from main to dpop_thumbprint_fix March 23, 2026 11:18
@pmathew92 pmathew92 marked this pull request as ready for review March 24, 2026 09:17
@pmathew92 pmathew92 requested a review from a team as a code owner March 24, 2026 09:17
Copilot AI review requested due to automatic review settings March 24, 2026 09:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds persistence of the DPoP key thumbprint into credentials storage so the SDK can later detect/handle DPoP-bound credentials across app/device lifecycle events.

Changes:

  • Adds a public AuthenticationAPIClient.isDPoPEnabled flag and a public DPoP.hasKeyPair() helper.
  • Introduces shared thumbprint persistence logic in BaseCredentialsManager.saveDPoPThumbprint(...), and invokes it during credential saves/clears in both credentials manager implementations.
  • Extends CredentialsManagerException with DPoP-related error codes/messages (as referenced by PR #939).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
auth0/src/main/java/com/auth0/android/dpop/DPoP.kt Adds public hasKeyPair() API to check KeyStore presence.
auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.kt Exposes isDPoPEnabled to let storage logic infer DPoP usage.
auth0/src/main/java/com/auth0/android/authentication/storage/BaseCredentialsManager.kt Implements thumbprint persistence/removal logic and introduces the storage key constant.
auth0/src/main/java/com/auth0/android/authentication/storage/CredentialsManager.kt Calls thumbprint persistence on save and removes it on clear.
auth0/src/main/java/com/auth0/android/authentication/storage/SecureCredentialsManager.kt Calls thumbprint persistence on save and removes it on clear; also stores token type.
auth0/src/main/java/com/auth0/android/authentication/storage/CredentialsManagerException.kt Adds DPoP-related exception codes and user-facing messages.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

internal const val KEY_ALIAS = "com.auth0.key"

@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
internal const val KEY_TOKEN_TYPE = "com.auth0.token_type"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: KEY_TOKEN_TYPE with the same value "com.auth0.token_type" already exists as a private const in CredentialsManager (line 764). Now we have it in two places — might drift. Since KEY_DPOP_THUMBPRINT was placed in BaseCredentialsManager for sharing, can we do the same for KEY_TOKEN_TYPE?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants